package com.gilgamesh.im;

import com.gilgamesh.im.common.ClientBootConfiguration;

import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.net.Socket;
import java.util.Scanner;

/**
* 即时通信的客户端
**/
public class IMClient {

    public static void main(String[] args) throws Exception{
        /**
        * 与服务端建立连接
        **/
        Socket socket = new Socket(
                ClientBootConfiguration.SERVERIP,
                ClientBootConfiguration.SERVERPORT
        );

        Scanner sc = new Scanner(System.in);

        OutputStream outputStream = socket.getOutputStream();
        PrintStream print = new PrintStream(outputStream);
        while(true){
            String s = sc.nextLine();
            print.println(s);
            print.flush();
        }

    }
}
